package com.yang.sso.oauth.oauth.clients.jdbc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;

import javax.sql.DataSource;

/**
 * jdcb 方式获取客户端 信息
 *
 * @author: Islands
 * @create: 2024-04-11 16:43
 */

@Configuration
public class JdbcClientConfig {

    @Autowired
    private DataSource dataSource;

    /**
     * jdbc查询
     * @return JdbcClientDetailsService
     */
    @Bean
    public JdbcClientDetailsService jdbcClientDetailsService() {
        return new JdbcClientDetailsService(dataSource);
    }
}
